<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<HEAD>
	<META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
<META NAME="VPSiteProject" CONTENT="file:///D|/WalkOfMind/Project.vpp">

	<TITLE>Character definitions</TITLE>
</HEAD>

<BODY BGCOLOR="silver">

<H1 ALIGN="CENTER">Pacman character definitions</H1>
<P>In ROM, a character is defined by a matrix of 8x8 pixels, with 2 bits per pixel. This makes it possible to store
4 pixels in a byte, and a whole in 16 bytes. Within a byte the bits are arranged in the following order:</P>
<CENTER>
<P>
<TABLE BORDER="1" CELLPADDING="0" CELLSPACING="0" WIDTH="75%">
	<TR>
		<TD WIDTH="10%" BGCOLOR="gray"><B>&nbsp;Bit</B></TD>
		<TD BGCOLOR="gray"><B>&nbsp;Description</B></TD>
	</TR>
	<TR>
		<TD WIDTH="10%">&nbsp;0</TD>
		<TD>&nbsp;Bit 0 of pixel #1</TD>
	</TR>
	<TR>
		<TD WIDTH="10%">&nbsp;1</TD>
		<TD>&nbsp;Bit 0 of pixel #2</TD>
	</TR>
	<TR>
		<TD WIDTH="10%">&nbsp;2</TD>
		<TD>&nbsp;Bit 0 of pixel #3</TD>
	</TR>
	<TR>
		<TD WIDTH="10%">&nbsp;3</TD>
		<TD>&nbsp;Bit 0 of pixel #4</TD>
	</TR>
	<TR>
		<TD WIDTH="10%">&nbsp;4</TD>
		<TD>&nbsp;Bit 1 of pixel #1</TD>
	</TR>
	<TR>
		<TD WIDTH="10%">&nbsp;5</TD>
		<TD>&nbsp;Bit 1 of pixel #2</TD>
	</TR>
	<TR>
		<TD WIDTH="10%">&nbsp;6</TD>
		<TD>&nbsp;Bit 1 of pixel #3</TD>
	</TR>
	<TR>
		<TD WIDTH="10%">&nbsp;7</TD>
		<TD>&nbsp;Bit 1 of pixel #4</TD>
	</TR>
</TABLE>
</P>
</CENTER>
<P>If the character pixel at X<I>, Y</I> is <I>aXY</I> then a character has the following layout:</P>

<BLOCKQUOTE>
	<PRE>a00 a10 ... a70
a01 ...     a71
...         ...
a07 a17 ... a77</PRE>
</BLOCKQUOTE>

<P>and the first eight bytes in the character map define the lower four rows:</P>

<BLOCKQUOTE>
	<PRE>a77:bit1 a76:bit1 a75:bit1 a74:bit1 a77:bit0 a76:bit0 a75:bit0 a74:bit0
a67:bit1 a66:bit1 a65:bit1 a64:bit1 a67:bit0 a66:bit0 a65:bit0 a64:bit0
a57:bit1 a56:bit1 a55:bit1 a54:bit1 a57:bit0 a56:bit0 a55:bit0 a54:bit0
a47:bit1 a46:bit1 a45:bit1 a44:bit1 a47:bit0 a46:bit0 a45:bit0 a44:bit0
a37:bit1 a36:bit1 a35:bit1 a34:bit1 a37:bit0 a36:bit0 a35:bit0 a34:bit0
a27:bit1 a26:bit1 a25:bit1 a24:bit1 a27:bit0 a26:bit0 a25:bit0 a24:bit0
a17:bit1 a16:bit1 a15:bit1 a14:bit1 a17:bit0 a16:bit0 a15:bit0 a14:bit0
a07:bit1 a06:bit1 a05:bit1 a04:bit1 a67:bit0 a06:bit0 a05:bit0 a04:bit0</PRE>
</BLOCKQUOTE>

<P>The following eight bytes define the upper rows with an identical layout.</P>

<P>It might seem strange that the pixels in a byte are arranged in columns rather than in rows, but this an artifact
due to the screen being rotated by ninety degrees in the cabinet. I have decided to talk directly in terms of the
actual screen but if we consider the <I>natural</I> screen layout then pixels do take the more usual arrangement
where pixels in a byte refer to pixels that are in the same row.</P>
<P ALIGN="CENTER"><FONT SIZE="2">Copyright (c) 1997-2004 </FONT><A HREF="mailto:dev@ascotti.org"><FONT SIZE="2">Alessandro
Scotti</FONT></A><FONT SIZE="2">. All rights reserved.</FONT>

</BODY>

</HTML>